<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:p="http://primefaces.org/ui"
   xmlns:f="http://xmlns.jcp.org/jsf/core">
    <ui:composition template="structpage/templates/defaultLayout.xhtml">
    <ui:define name="title">
        <h:outputText value="ChequeTeatinos"/>
    </ui:define>

    <ui:define name="content"> 
        <h:form id="form" >    
            <p:dataGrid styleClass="gridstyle" paginatorPosition="bottom" value="#{ofertasBean.ofertas}" var="c" columns="3"  
            rows="6" paginator="true" 
            paginatorTemplate="{PreviousPageLink} {PageLinks} {NextPageLink} {RowsPerPageDropdown}" 
            rowsPerPageTemplate="6,9">  
                <p:panel header="#{c.nombreOferta}" style="text-align:center">
                    <h:panelGrid columns="1" style="width:100%">  
                        <p:graphicImage value="#{c.empresa.imagen}"/>   
                        <h:outputText styleClass="precio" value="#{c.precioConOferta} €"/>
                    </h:panelGrid> 
                    <p:commandButton id="viewOffer" value="#{msg.viewOffer}" action="#{ofertasBean.viewOffer()}" >
                        <f:setPropertyActionListener value="#{c}" target="#{ofertasBean.selectedOffer}" />
                    </p:commandButton>
                </p:panel>
            </p:dataGrid>
        </h:form>  
    </ui:define>
    </ui:composition>
</html>